package utgame.com.broadcastdemo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;



//广播接收器中不允许开启线程，当onReceive方法运行了较长时间而没有结束时,程序就会报错。
//因此广播接收器更多的扮演一种打开程序其他组件的角色，如创建一条状态栏显示通知，或者启动服务
public class BootCompleteReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.
//        throw new UnsupportedOperationException("Not yet implemented");

        Toast.makeText(context, "action: " + intent.getAction(), Toast.LENGTH_LONG).show();
    }
}
